home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / rexx / mailboxfunctions.avm < prev    next >
Text File  |  1994-06-24  |  2KB  |  62 lines

  1. exit
  2.  
  3. /* this requires logfunctions.avm */
  4.  
  5. loadMailbox: procedure expose mailbox.
  6.     if arg() ~= 1 then do
  7.         rc = "loadMailbox: bad args"
  8.         signal error
  9.     end
  10.  
  11.         mailbox. = ''
  12.     parse arg mailbox
  13.  
  14.     handle = 'mailboxconfig'
  15.     opened = open(handle, mailboxDir(mailbox) || 'mailbox.cfg', 'r')
  16.     if opened then do
  17.         do while ~eof(handle)
  18.             line = readln(handle)
  19.             parse upper var line variable '=' value
  20.             mailbox.variable = value
  21.         end
  22.         call close(handle)
  23.     end
  24.     return
  25.  
  26. /* pass a handle here */
  27. saveMailbox: procedure expose mailbox.
  28.     if arg() ~= 1 then do
  29.         rc = "saveMailbox: bad args"
  30.         signal error
  31.     end
  32.     parse arg mailbox
  33.  
  34.     handle = 'mailboxconfig'
  35.     opened = open(handle, mailboxDir(mailbox) || 'mailbox.cfg', 'w')
  36.  
  37.     if opened then do
  38.         call writeln(handle, 'PASSWORD=' || mailbox.password)
  39.  
  40.         call writeln(handle, 'AUTOFAXFORWARDB=' || mailbox.autofaxforwardb)
  41.         call writeln(handle, 'AUTOFAXFORWARD=' || mailbox.autofaxforward)
  42.         call writeln(handle, 'AUTOFAXFORWARDSCRIPT=' || mailbox.autofaxforwardscript)
  43.  
  44.         call writeln(handle, 'AUTOFORWARDB=' || mailbox.autoforwardb)
  45.         call writeln(handle, 'AUTOFORWARDONDEMAND=' || mailbox.autoforwardondemand)
  46.         call writeln(handle, 'AUTOFORWARD=' || mailbox.autoforward)
  47.         call writeln(handle, 'AUTOFORWARDSCRIPT=' || mailbox.autoforwardscript)
  48.  
  49.         call writeln(handle, 'AUTOPAGEB=' || mailbox.autopageb)
  50.         call writeln(handle, 'AUTOPAGEONDEMAND=' || mailbox.autopageondemand)
  51.         call writeln(handle, 'AUTOPAGE=' || mailbox.autopage)
  52.         call writeln(handle, 'AUTOPAGESCRIPT=' || mailbox.autopagescript)
  53.  
  54.         call writeln(handle, 'AUTOALERTB=' || mailbox.autoalertb)
  55.         call writeln(handle, 'AUTOALERTONDEMAND=' || mailbox.autoalertondemand)
  56.         call writeln(handle, 'AUTOALERTSCRIPT=' || mailbox.autoalertscript)
  57.  
  58.         call close(handle)
  59.     end
  60.  
  61.     return
  62.